Skip to content

#492: Use Maven dependency cache in CI workflows - #2412

Open
krystynaShatkovska wants to merge 4 commits into
devonfw:mainfrom
krystynaShatkovska:feature/492-maven-cache
Open

krystynaShatkovska wants to merge 4 commits into
devonfw:mainfrom
krystynaShatkovska:feature/492-maven-cache

Conversation

@krystynaShatkovska

@krystynaShatkovska krystynaShatkovska commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes #492

Implemented changes:

Added cache: 'maven' to the setup-java@v5 step in build.yml, build-pr.yml, mutation-test.yml, and the deploy job of nightly-build.yml, so these jobs restore a shared ~/.m2/repository dependency cache instead of re-downloading all Maven dependencies on every run. This matches the convention already used in release.yml, update-cve.yml, and update-urls.yml.
The cache is keyed on the hash of the pom.xml files (handled automatically by setup-java), so it is reused while dependencies are unchanged and only re-created when they change


Testing instructions

  1. Open this PR, expand the CI Build PR run -> Set up JDK step. Look for the cache line. It should be a hit ("Cache restored successfully…") because main's CI has already cached this dependency set (the pom.xml files are unchanged from main). A miss only occurs the first time a new dependency set is ever cached.
  2. On Checks , then hover CI Build PR, then Re-run jobs. The re-run (same commit, same pom.xml) should log a hit again, with a minimal Maven download.
  3. Confirm the Set up JDK step / total run is noticeably faster than a cold run, most artifacts restored, not re-downloaded.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat and not feature/921 fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summaries what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labelled
    with internal
  • You have not changed any dependency in pom.xml files or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Sep 3, 2026
@krystynaShatkovska krystynaShatkovska moved this from 🆕 New to 🏗 In progress in IDEasy board Sep 3, 2026
@krystynaShatkovska krystynaShatkovska added enhancement New feature or request SCM software-configuration-management (github actions, internal processes, git or github utilization) workflow GitHub actions (CI,CD,update urls/CVEs) labels Sep 3, 2026
@coveralls

coveralls commented Sep 3, 2026 •

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 35583719736

Warning

No base build found for commit e224e69 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 74.238%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 19097
Covered Lines: 14808
Line Coverage: 77.54%
Relevant Branches: 8548
Covered Branches: 5715
Branch Coverage: 66.86%
Branches in Coverage %: Yes
Coverage Strength: 3.32 hits per line

💛 - Coveralls

@laert-ll laert-ll self-assigned this Sep 3, 2026
@laert-ll laert-ll moved this from 🏗 In progress to Team Review in IDEasy board Sep 3, 2026

@laert-ll laert-ll left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work!

I think additionally, you should also add the cache to graalvm/setup-graalvm@v1 as well in .github/workflows/nightly-build.yml and .github/workflows/release.yml. Other than that, it looks good to me. Remember to link the issue in the description and to label it as internal.

The build-natives jobs in nightly-build.yml and release.yml also build
with Maven after checking out the repository, so give the
graalvm/setup-graalvm@v1 step the same maven dependency cache that was
already added to the setup-java steps.
@krystynaShatkovska krystynaShatkovska added the internal Nothing to be added to CHANGELOG, only internal story label Sep 21, 2026
@laert-ll laert-ll moved this from Team Review to 👀 In review in IDEasy board Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request internal Nothing to be added to CHANGELOG, only internal story SCM software-configuration-management (github actions, internal processes, git or github utilization) workflow GitHub actions (CI,CD,update urls/CVEs)

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

Use Maven dependency cache to optimize workflow running times

3 participants